import request from 'axios';

export const addDataReq = (data) => {
  return request({
    url: '/api/user/add',
    method: 'post',
    data: data,
  });
};

export const deleteDataReq = (id) => {
  return request({
    url: `/api/user/del`,
    method: 'get',
    params: {
      ids: id,
    },
  });
};

export const updateDataReq = (data) => {
  return request({
    url: `/api/user/update`,
    method: 'post',
    data: {
      ...data,
      type: 'SUPERMARKET',
    },
  });
};

export const getDetailReq = (id) => {
  return request({
    url: `/api/user/detail`,
    method: 'get',
    params: {
      id: id,
    },
  });
};

//获取商超列表
export const getListReq = (data) => {
  return request({
    url: `/api/user/list`,
    method: 'post',
    data: data,
  });
};

// 导出
export const exportDataReq = (data) => {
  return request({
    url: `/api/vpp-pvsc-core/device/deliverBatchLog/exportBatchLog`,
    method: 'post',
    params: data,
    responseType: 'blob',
  });
};
